<?php 
$CI = & get_instance();
$ur = $CI->uri->segment(4);
echo form_open('admin/news/request'); ?><!-- start title -->
<div class="title corners_top" style="float:left;width:600px;">
	<h6 id="tables" >
		Danh sách tin tức <span style="color:#F00"> <?php echo $name_cat?>	</span>
	</h6>
</div>
<!-- end title -->
<div class="proccess_bar">           
	<ul class="menu_bar" style="width:135px;">
		<li> 
        	<a href="<?php echo base_url(); ?>index.php/admin/news_cat" ><span style="background:url(<?php echo base_url(); ?>/public/images/admin/icon/backward.png) no-repeat" class="new-1"> </span>Back</a>
        </li>
    
		<li> 
        	<a href="<?php echo base_url(); ?>index.php/admin/news/create/<?php echo $catID?>" ><span class="new-1"> </span>New</a>
        </li>
		<li>
			<?php  $data = array('name' => 'delete', 'value' => '','class'=>'delete-1', 'id' => 'delete');
				   echo form_submit($data);
			?>  
             Delete
        </li>
	</ul>
</div>
<?php		
	if (!empty($result))
	{
?>
		<div class="content">
			<table cellspacing="1" class="tablesorter">
<?php 
				if (is_array($result) )
				{
					echo '<thead>';
						echo '<tr>';
							echo '<th width="50">';
								$data = array(
												'name'        => 'checkall',
												'id'          => 'checkall',
											  );
								echo '&nbsp;',form_checkbox($data ),'&nbsp;All';
							echo '</th>';
							echo '<th width="50">'.$this->lang->line('code').'</th>';
							echo '<th width="200">Tên dịch vụ </th>';
							echo '<th width="200">Hình </th>';
							echo '<th width="100">Trạng thái</th>';
							echo '<th width="60" >Ngày Cập nhật</th>';
							echo '<th width="70" >Chức năng</th>';
						echo '</tr>';
					echo '</thead>';
					echo '<tbody>';
						foreach ($result as $row)
						{
							echo '<tr>';
								echo '<td>';
									$data = array(
													'name'        => 'checkbox1[]',
													'id'          => 'checkbox1[]',
													'value'=>  $row['news_id']
												  );
									echo form_checkbox($data, $row['news_id']);
									echo '&nbsp;';
								echo '</td><td>';
									echo $row['news_id'];
								echo '</td>';
								echo '<td >';
									echo  html_entity_decode($row['news_name'], ENT_QUOTES, 'UTF-8');
								echo '</td >';
								echo '<td >';
									if (!empty($row['news_image']))
									{
									  echo '<center><img width="100px" src="'.base_url().'upload/news/'.$row["news_image"].'" /> </center>';	
									}
									else 
									  echo '<center>Không hình</center>';
								echo '</td >';
								echo '<td >';
									if($row['news_status'] == 1)
										echo 'hiển thị';
									else
										echo 'ẩn';
								echo '</td>';			
								echo '<td >';
									echo date('d-m-Y h:i',($row['news_modify']));
								echo '</td>';			
								echo '<td>
											<!--<a href="javascript:();"><img src="'.base_url() .'public/images/admin/zoom.png" width="16" height="16" alt="preview" title="preview" /></a>-->';
								echo '<a href="'.base_url().'index.php/admin/news/update/'.$catID.'/'.$row['news_id'].'">
											<img src="'.base_url().'public/images/admin/edit.png" width="16" height="16" alt="edit" title="edit" /></a> ';
								echo '<a href="javascript:deleteRecord(\''.$row['news_id'].'\',\''.base_url().'index.php/admin/news/delete/'.$catID.'/'.$row['news_id'].'\');"><img src="'. base_url().'public/images/admin/delete.png" width="16" height="16" alt="delete" title="delete" /></a></td>';
							echo '</tr>';
						}
					echo '</tbody>';
?>
			</table>
<?php 
		}
		else
			echo "<font size='+1'><b> 	Data does not exit </b></font>";
?>
<!-- <div class="float_left margin_10_0">
<a href="javascript:();"><img src="<?php echo base_url(); ?>public/images/admin/edit.png" width="16" height="16" alt="edit" /></a> 
<a href="javascript:();"><img src="<?php echo base_url(); ?>public/images/admin/delete.png" width="16" height="16" alt="delete" /></a></div>-->
<div class="pagination float_right margin_10_0">
<?php echo $page; ?></div>
<?php
}
else
{

echo '    <div><a href="javascript:();" title="Succes box" class="box warning corners"><span class="close">&nbsp;</span>Data does not exist</a></div>';

}
?>
</div><!-- end title -->

<?php echo form_close(); 

?>